﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel;

namespace Timeline
{
    public class TimelineAdditionalIndicator
    {
        #region Member variables

        private int _year;
        private string _text;
        private string _labelCssClass;
        private string _labelArrowCssClass;
        private string _toolTip;
        private string _onClickJS;

        #endregion

        #region Properties

        /// <summary>
        /// Gets or sets the year.
        /// </summary>
        /// <value>
        /// The year.
        /// </value>
        /// <exception cref="System.ArgumentException">Value cannot be lower then 0!</exception>
        [Bindable(true), Category("Values"), DefaultValue("1990"), Description("Year.")]
        public int Year
        {
            get { return _year; }

            set
            {
                if (value < 0)
                    throw new ArgumentException("Value cannot be lower then 0!");

                _year = value;
            }
        }

        /// <summary>
        /// Gets or sets the text.
        /// </summary>
        /// <value>
        /// The text.
        /// </value>
        [Bindable(true), Category("Values"), DefaultValue(""), Description("Text.")]
        public string Text
        {
            get { return _text; }
            set { _text = value; }
        }

        /// <summary>
        /// Gets or sets the label CSS class.
        /// </summary>
        /// <value>
        /// The label CSS class.
        /// </value>
        [Bindable(true), Category("Values"), DefaultValue(""), Description("Css class to use for setting the label.")]
        public string LabelCssClass
        {
            get { return _labelCssClass; }
            set { _labelCssClass = value; }
        }

        /// <summary>
        /// Gets or sets the label arrow CSS class.
        /// </summary>
        /// <value>
        /// The label arrow CSS class.
        /// </value>
        [Bindable(true), Category("Values"), DefaultValue(""), Description("Css class to use for setting the label arrow.")]
        public string LabelArrowCssClass
        {
            get { return _labelArrowCssClass; }
            set { _labelArrowCssClass = value; }
        }

        /// <summary>
        /// Gets or sets the tool tip.
        /// </summary>
        /// <value>
        /// The tool tip.
        /// </value>
        [Bindable(true), Category("Values"), DefaultValue(""), Description("Tool tip.")]
        public string ToolTip
        {
            get { return _toolTip; }
            set { _toolTip = value; }
        }

        /// <summary>
        /// Gets or sets the on click js.
        /// </summary>
        /// <value>
        /// The on click js.
        /// </value>
        [Bindable(true), Category("Values"), DefaultValue(""), Description("OnClick javascript.")]
        public string OnClickJS
        {
            get { return _onClickJS; }
            set { _onClickJS = value; }
        }

        #endregion

        #region Constructors

        /// <summary>
        /// Initializes a new instance of the <see cref="TimelineAdditionalIndicator"/> class.
        /// </summary>
        public TimelineAdditionalIndicator()
        {

        }

        /// <summary>
        /// Initializes a new instance of the <see cref="TimelineAdditionalIndicator"/> class.
        /// </summary>
        /// <param name="year">The year.</param>
        /// <param name="backgroundCssClass">The background CSS class.</param>
        /// <param name="tooltip">The tooltip.</param>
        /// <param name="onClickJS">The on click js.</param>
        public TimelineAdditionalIndicator(string text, string labelCssClass, string labelArrowCssClass, string tooltip, string onClickJS)
        {
            Text = text;
            LabelCssClass = LabelCssClass;
            LabelArrowCssClass = labelArrowCssClass;
            ToolTip = tooltip;
            OnClickJS = OnClickJS;
        }

        #endregion
    }
}